package br.com.academia.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.Properties;

public class ConnectionFactory {

	/*
	 * Conex�o direta com o Banco de Dados MySql
	 */
	public Connection getConnection() {
		try {
			Class.forName("com.mysql.jdbc.Driver").newInstance();
			Properties properties = new Properties();
			properties.put("user", "root");
			properties.put("password", "");
			return DriverManager.getConnection(
					"jdbc:mysql://localhost/academia", properties);
		} catch (SQLException | InstantiationException | IllegalAccessException
				| ClassNotFoundException e) {
			e.printStackTrace();
		}
		return null;
	}

}